// Boost.STL2 library
//
//  Copyright Fernando Pelliccioni 2012.
//  Use, modification and distribution is subject to the Boost Software
//  License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
//  http://www.boost.org/LICENSE_1_0.txt)
//
// For more information, see http://www.boost.org/libs/range/
//

#ifndef range_access_HPP__
#define range_access_HPP__

#include "iterator_range.hpp"

//For future C++1X containers

//namespace std2 {


namespace boost {
namespace container {

//TODO: http://www.boost.org/doc/libs/1_47_0/boost/range/begin.hpp

template <typename C>
inline auto all( C & c ) -> decltype( c.all() )
{
	return c.all();
}

template <typename C>
inline auto all( C const& c) -> decltype( c.all() )
{
	return c.all();
}


template <typename C>
inline auto begin( C & c ) -> decltype( c.all().begin() )
{
	return c.all().begin();
}

template <typename C>
inline auto begin( C const& c) -> decltype( c.all().begin() )
{
	return c.c.all().begin();
}

template <typename C>
inline auto end( C & c ) -> decltype( c.all().end() )
{
	return c.all().end();
}

template <typename C>
inline auto end( C const& c) -> decltype( c.all().end() )
{
	return c.c.all().end();
}




//template<class T, size_t N> 
//inline T* all( T (&array)[N] )

template<class T, size_t N> 
inline iterator_range<T*> all( T (&array)[N] )
{	
	return iterator_range<T*>(&array[0], &array[0] + N);
}


} //namespace container
} //namespace boost

//} //namespace std2


#endif // range_access_HPP__